package org.zy.service.impl;

import javax.annotation.Resource;
import javax.xml.ws.ServiceMode;

import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.zy.bean.tuser;
import org.zy.commons.SqlSessionTool;
import org.zy.dao.tuserMapper;
import org.zy.service.IUserService;

public class UserService implements IUserService {
	private tuserMapper tusermapper;

	public tuserMapper getTusermapper() {
		return tusermapper;
	}

	public void setTusermapper(tuserMapper tusermapper) {
		this.tusermapper = tusermapper;
	}

	public tuser getUserInfo(int user_id) {
		 SqlSession session = SqlSessionTool.openSession();
		 tuserMapper dao = session.getMapper(tuserMapper.class);
		 tuser user = dao.getAll3(user_id, new RowBounds(1, 1));
		 SqlSessionTool.closeSession();
//		tuser user = tusermapper.getAll3(1, new RowBounds(0, 2));
		return user;
	}
}
